package com.henu.art.controller;

import com.henu.art.annotation.IgnoreToken;
import com.henu.art.service.loginService;
import com.henu.art.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.List;

@RestController
@IgnoreToken
@RequestMapping("teacher")
public class loginController {

    @Autowired
    private loginService service;

    @PostMapping("/login")
    public Result<?> login(@RequestParam String id,@RequestParam String password) {
        if (service.login(id, password)) {
            return Result.ok("登录成功");
        }
        return Result.ok("登录失败");
    }
}
